<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <script type="text/javascript" src="./script/jquery.min.js"></script>
    <script type="text/javascript" src="./script/doT.min.js"></script>
    <script type="text/javascript" src="./script/base.js"></script>
    <script type="text/javascript" src="./script/api.js"></script>
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>

<body>


    <div class="foot-t"></div>
    <ul class="foot">
        <li tapmode id="li0" class="li_index active">
            <i class="aui-iconfont aui-icon-home"></i>
            <p onclick="randomSwitchBtn( 0 );">首页</p>
        </li>
        <li tapmode id="li1" class="li_index">
            <i class="aui-iconfont aui-icon-my"></i>
            <p onclick="randomSwitchBtn( 1 );">我的</p>
        </li>
    </ul>

</body>

<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
    function openClub() {
        var delay = 0;
        if (api.systemType != 'ios') {
            delay = 300;
        }
        api.openWin({
            name: 'club_win',
            url: './html/club_win.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    }

    function closeWin() {
        api.closeWin({});
    }

    apiready = function() {

        //       var userid = $api.getStorage('userid');
        // var url = '';
        //       if (!userid) {
        // var url = './login.html';
        //       } else {
        // var url = './index.html';
        //       }

        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {
            if (ret) {
                // alert(JSON.stringify(ret));
                api.closeWidget({
                    id: 'A6090245134876',
                    retData: {
                        name: 'closeWidget'
                    },
                    animation: {
                        type: 'flip',
                        subType: 'from_bottom',
                        duration: 500
                    }
                });
            } else {
                // alert(JSON.stringify(err));
            }
        });

        api.openFrameGroup({
            name: 'nav',
            scrollEnabled: false,

            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                marginBottom: 50
            },
            frames: [{
                name: 'index',
                url: './index.html',
                bgColor: '#fff'
            }, {
                name: 'user',
                url: './user.html',
                bgColor: '#fff'
            }]
        }, function(ret, err) {

        });




        // addListener();
        // 初始化极光推送
        // addJKPush();
        // registerjkPush();
    }

    function randomSwitchBtn(index) {
        // var allImg = $(".foot li img");
        var li_id = "li" + index;

        $(".li_index").removeClass("active");
        $("#" + li_id).addClass('active');

        api.setFrameGroupIndex({
            name: 'nav',
            index: index,
            reload: true,
        });

    }
</script>

</html>
